package com.qianfeng.entity;

/**
 * 通用的前端返回类，用于统一包装后端的返回数据
 * @author 李康
 */
public class Result {
    public static int SUCCESS = 200;
    public static int WANING = 400;
    public static int ERROR = 500;

    /**
     * 时间戳
     */
    private long time;
    /**
     * 自定义的返回代代码
     */
    private int code = -1;

    /**
     * 携带的返回的数据
     */
    private Object data;

    /**
     * 返回的提示文本信息
     */
    private String msg;

    public Result(){
        this.time = System.currentTimeMillis();
    }

    public long getTime() {
        return time;
    }

    public int getCode() {
        return code;
    }


    public Object getData() {
        return data;
    }

    public String getMsg() {
        return msg;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
